package com.ys.erp.stage_emp_service.bean.conditon;

import com.ys.erp.framework.condition.BasePageCondition;
import io.swagger.annotations.ApiModel;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author 南山
 * @date 2025/07/25 16:10
 */
@Schema(description = "员工相关接口请求参数相关对象")
@Data
public class EmpCondition {

    @Data
    @Schema(description = "员工登录接口请求参数对象")
    public static class EmpLoginCondition {

        @Schema(description = "账号")
        @NotBlank(message = "账号不能为空")
        private String account;

        @Schema(description = "密码")
        @NotBlank(message = "密码不能为空")
        private String password;

    }

    @Data
    @Schema(description = "员工设置店铺接口请求参数对象")
    public static class EmpSettingShopCon {
        @Schema(description = "员工id")
        private Long empId;
        @Schema(description = "店铺id")
        private List<String> shopCodeList;

    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @Schema(description = "员工分页对象")
    public static class PageEmployeeCon extends BasePageCondition {
        @Schema(description = "realName")
        private String realName;
        @Schema(description = "phone")
        private String phone;
        @Schema(description = "shopCode")
        private String shopCode;
        @Schema(description = "roleId")
        private Long roleId;
        @Schema(description = "statusDescribe")
        private String statusDescribe;

        @Schema(description = "是否离职")
        private Integer isDepart;

    }

    @Data
    @Accessors(chain = true)
    @Schema(description ="添加或编辑员工请求对象")
    public static class AddOrUpdateEmpCon {

        @Schema(description ="主键")
        private Long id;

        @Schema(description ="角色id")
        @NotNull
        private Long roleId;

        @Schema(description ="门店")
        @NotNull
        private List<String> shopCodeList;

        @Schema(description ="真实姓名")
        @NotBlank
        private String realName;

        @Schema(description ="手机号")
        @NotBlank
        @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "手机号码格式不合法")
        private String phone;

        @Schema(description ="是否禁用")
        @NotNull
        @Max(1)
        @Min(0)
        private Integer isDisable;

        @Schema(description ="状态描述")
        private String statusDescribe;

        @Schema(description ="直属上级领导")
        private Long parentId;

        @Schema(description ="银行账户")
        private String bankAccount;

        @Schema(description ="银行名字")
        private String bankName;

    }
}
